package me.fangx.zhihu.ui.activity;

/**
 * 作者： Owen
 * 时间： 2016/5/30 0030 20:48
 * 类说明：
 */

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;

import me.fangx.zhihu.R;
import me.fangx.zhihu.modle.dao.DBManager;


public class SplashActivity extends AppCompatActivity {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(1024, 1024);
        setContentView(R.layout.activity_splash);
        initView();
    }

    public void initView() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                DBManager.copyDatabase();
            }
        }).start();

        new Handler().postDelayed(new Runnable() {
            public void run() {
                SplashActivity.this.startActivity(new Intent(SplashActivity.this, HomeActivity.class));
                SplashActivity.this.finish();
            }
        }, 2000);
    }

    protected void onResume() {
        super.onResume();
    }

    protected void onPause() {
        super.onPause();
    }

    @Override
    public void onBackPressed() {
        return;
    }
}
